import mxnet.gluon.nn as nn


class Tree:
    def __init__(self, idx):
        self.idx = idx
        self.children = []

    def __repr__(self):
        if self.children:
            return '{0}: {1}'.format(self.idx, str(self.children))
        else:
            return str(self.idx)


if __name__ == '__main__':
    tree = Tree(0)
    tree.children.append(Tree(1))
    tree.children.append(Tree(2))
    tree.children.append(Tree(3))
    tree.children[1].children.append(Tree(4))
    print(tree)
